package org.java;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Map;
import java.util.Properties;
import java.util.Scanner;

/**
 * @author Zhang Guangyong
 * @desacription 主测试类
 * @date 2019年07月19日 10:52
 */
public class Main {

    public static void main(String[] args) throws IOException {

        double a = 0.05;
        double b = 0.01;

        System.out.println(a + b);



        Scanner scanner = new Scanner(new File("D:\\@备份文件\\其他文档\\P站新墙孔.txt"));
        while (scanner.hasNextLine()) {
            System.out.println(scanner.nextLine());
        }

        //获取环境变量
        Map<String, String> env = System.getenv();
        for (String s : env.keySet()) {
            System.out.println(s + " : "+ env.get(s));
        }
        //获取系统属性
        System.out.println("获取系统属性");
        Properties properties = System.getProperties();
        for (Object o : properties.keySet()) {
            System.out.println(o + " : "+ properties.get(o));
        }
        //输出到文件
        properties.store(new FileOutputStream("D:\\系统属性.txt"),"system");

    }
}